<?php
$s = 'When is this even worth it? Will it ever even happen or am I just wasting my time? I just don\'t get it.. this is a random amount of data that is to be compressed!';
$s = $s.$s.$s.$s;
$c = gzcompress($s,3);
echo strlen($s)."<br>";
echo strlen($c)."<br>";
?> 
<?php
if(!file_exists("./test112.zip")) {
$zip = new ZipArchive();
$filename = "./test112.zip";

if ($zip->open($filename, ZIPARCHIVE::CREATE)!==TRUE) {
   exit("cannot open <$filename>\n");
}

$zip->addFromString("testfilephp.txt" . time(), "#1 This is a test string added as testfilephp.txt.\n");
$zip->addFromString("testfilephp2.txt" . time(), "#2 This is a test string added as testfilephp2.txt.\n");
$zip->addFile($thisdir . "/too.php","/index.php");
echo "numfiles: " . $zip->numFiles . "\n";
echo "status:" . $zip->status . "\n";
$zip->close();
}
?>
